home *** CD-ROM | disk | FTP | other *** search
- Path: fluke-f.icase.edu!erlebach
- From: erlebach@fluke-f.icase.edu (Erlebacher Gordon)
- Newsgroups: comp.lang.c
- Subject: unblocked reads from pipes
- Date: 22 Jan 1996 02:35:54 GMT
- Organization: ICASE/NASA Langley
- Distribution: world
- Message-ID: <4dut6a$l3s@reznor.larc.nasa.gov>
- NNTP-Posting-Host: fluke.icase.edu
-
- I have been using pipes to communcate between two programs. Program
- B is launched from program A (via fork/execl), and 2 pipes are set up,
- one for reading from program B, and one to read from it. When
- using the read routine to read the pipe, I noticed it is blocked. If the
- pipe is empty, the read does not return. How can I perform either:
-
- 1) check for data in the pipe before reading from it,
-
- 2) read the pipe in such a way that if it is emply, to return back to
- the calling module.
-
- Thanks for any help,
-
- Gordon
-